package com.ht.aems.fes.util;

import java.io.FileReader;
import java.io.InputStreamReader;
import java.io.BufferedReader;
import java.io.IOException;
import java.util.Map;
import java.util.HashMap;

/**
 * @author SU Xinyi
 * @since 2009-6-1
 */
public class PointNumMapper {
    private Map<Integer, Integer> pointNumMap = new HashMap<Integer, Integer>();

    public Map<Integer, Integer> getPointNumMap() {
        return pointNumMap;
    }

    public PointNumMapper(String path) throws IOException {
        BufferedReader bufferedReader = new BufferedReader(new FileReader(path));
        bufferedReader.readLine();
        do{
            String line = bufferedReader.readLine();
            if(line == null){
                break;
            }
            String[] datas = line.split("\t");
            try{
                Integer p1 = Integer.valueOf(datas[0]);
                Integer p2 = Integer.valueOf(datas[1]);                
                pointNumMap.put(p1, p2);
            }catch (Exception e){}

        }while(true);
    }

    public static void main(String[] args) {
        try {
            Map<Integer, Integer> map = new PointNumMapper(PointNumMapper.class.getResource("/config/yxmap.txt").getPath()).getPointNumMap();
        } catch (IOException e) {
            e.printStackTrace();  //To change body of catch statement use File | Settings | File Templates.
        }
    }
}
